<?php
function getLink($url,$text='') {
  if(empty($text)) {
    $split = split('/',$url);
    $text = $split[count($split)-1];
  }
  return "<a href='".getURL($url)."'>$text</a>";
}
function getURL($url) {
  if(eval($GLOBALS['config']['enable_mod_rewrite'])) {
    return baseURL().$url;
  } else {
    return baseURL()."index.php/".$url;
  }
}
function baseURL() {
  return $GLOBALS['config']['url'];
}
function ipLink($ip) {
  return "<a href='http://ws.arin.net/cgi-bin/whois.pl?queryinput=$ip'>$ip</a>";
}
?>